# 这个代码是我理解错了题意；但是我觉得按照题意写变得更没有意思了。
from itertools import cycle

class Solution:
    def clumsy(self, n: int) -> int:
        funcs = [(lambda a,b: a*b), (lambda a,b: a//b), (lambda a,b: a+b), (lambda a,b: a-b)]
        res = n
        for f, x in zip(cycle(funcs), range(n-1, 0, -1)):
            res = f(res, x)
        return res

if __name__ == '__main__':
    s = Solution()
    print(s.clumsy(4))
